$(document).ready(function(){
	
	$('select[name="category[default][pageType]"]').change(function(){
		loadCategoryModuleParams(this.value, $('#page_module_params_block'));
	});
	
});

function loadCategoryModuleParams(pageTypeValue, blockContainer)
{
    $.getJSON(
			'<?=Mozg_Router::Get('http')->Create(array('module' => 'admin', 'ctrl' => 'structure', 'action' => 'get_module_params_block', 'cat' => $this->cid , 'subcat' => $this->category->GetId()));?>',
			{
				'page_type': pageTypeValue
			},
			function(data){
				HandleResponseJSON(data, function(data){
					blockContainer.html(data);
				});	
			}
		);	
}